package core;

import java.util.Date;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import common.Servlet;
import utils.DateUtil;

public class Receive extends Servlet {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public synchronized void process(HttpServletRequest request, HttpServletResponse response) throws Exception {

		System.out.println(DateUtil.format(new Date(), DateUtil.DATETIME) + " | 接收回调");
		
		// 日志打印回调数据
		@SuppressWarnings("unchecked")
		Map<String,String[]> requestMap = request.getParameterMap();
		StringBuffer rece = new StringBuffer();
		for(Map.Entry<String,String[]> e: requestMap.entrySet()){
			rece.append(e.getKey() + "=" + e.getValue() + "&");
			 //System.out.println(e.getKey()+"==="+e.getValue());
		} 
		response.getWriter().print("ok");
	}
}
